package org.dht.com.tra.str;

import org.dht.com.msg.Message;
import org.dht.com.tra.Responder;

/**
 * The <code>MulticastManagerStructure</code> class is an
 * <code>Communicator</code> and implement for data structure
 * 
 * 
 */
public class MulticastManagerStructure extends TransferManagerStructure {

	/**
	 * Reference to CommunicationDataStructure
	 */
	private CommunicationDataStructure communicationDataStructure;

	/**
	 * Builds a MulticastManagerStructure
	 * 
	 * @param communicationDataStructure
	 */
	public MulticastManagerStructure(
			CommunicationDataStructure communicationDataStructure,
			Responder responder) {
		super(responder);
		this.communicationDataStructure = communicationDataStructure;
	}

	/**
	 * Not implemented
	 */
	public Message reciever() {
		return null;
	}

	/**
	 * Send message through of CommunicationDataStructure
	 */
	public void send(Message message) {

		if (!responder.releaseResponse(message)) {
			communicationDataStructure.notifyMulticast(message);
		} else {
			communicationDataStructure.notifyMessage(message);
		}
	}

	/**
	 * Not implemented
	 */
	public void stop() {

	}

}
